package com.ruoyi.manage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.manage.mapper.GYhCompanyMapper;
import com.ruoyi.manage.domain.GYhCompany;
import com.ruoyi.manage.service.IGYhCompanyService;

/**
 * 养护公司Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-10-11
 */
@Service
public class GYhCompanyServiceImpl implements IGYhCompanyService 
{
    @Autowired
    private GYhCompanyMapper gYhCompanyMapper;

    /**
     * 查询养护公司
     * 
     * @param companyId 养护公司主键
     * @return 养护公司
     */
    @Override
    public GYhCompany selectGYhCompanyByCompanyId(Long companyId)
    {
        return gYhCompanyMapper.selectGYhCompanyByCompanyId(companyId);
    }

    /**
     * 查询养护公司列表
     * 
     * @param gYhCompany 养护公司
     * @return 养护公司
     */
    @Override
    public List<GYhCompany> selectGYhCompanyList(GYhCompany gYhCompany)
    {
        return gYhCompanyMapper.selectGYhCompanyList(gYhCompany);
    }

    /**
     * 新增养护公司
     * 
     * @param gYhCompany 养护公司
     * @return 结果
     */
    @Override
    public int insertGYhCompany(GYhCompany gYhCompany)
    {
        gYhCompany.setCreateTime(DateUtils.getNowDate());
        return gYhCompanyMapper.insertGYhCompany(gYhCompany);
    }

    /**
     * 修改养护公司
     * 
     * @param gYhCompany 养护公司
     * @return 结果
     */
    @Override
    public int updateGYhCompany(GYhCompany gYhCompany)
    {
        gYhCompany.setUpdateTime(DateUtils.getNowDate());
        return gYhCompanyMapper.updateGYhCompany(gYhCompany);
    }

    /**
     * 批量删除养护公司
     * 
     * @param companyIds 需要删除的养护公司主键
     * @return 结果
     */
    @Override
    public int deleteGYhCompanyByCompanyIds(Long[] companyIds)
    {
        return gYhCompanyMapper.deleteGYhCompanyByCompanyIds(companyIds);
    }

    /**
     * 删除养护公司信息
     * 
     * @param companyId 养护公司主键
     * @return 结果
     */
    @Override
    public int deleteGYhCompanyByCompanyId(Long companyId)
    {
        return gYhCompanyMapper.deleteGYhCompanyByCompanyId(companyId);
    }
}
